import React, { Component } from 'react';
import { BrowserRouter,Route, Switch } from 'react-router-dom';
import LocaleProvider from 'antd/lib/locale-provider';
import zhCN from 'antd/lib/locale-provider/zh_CN';
import 'antd/dist/antd.css'
import routes from './router';

class App extends Component {
    render() {
        return(
            <LocaleProvider locale={zhCN}>
                <BrowserRouter>
                    <Switch>
                        {routes.map((route, index) => {
                            return <Route
                                key={index}
                                path={route.path}
                                exact={route.exact}
                                component={route.component}/>
                        })}
                    </Switch>
                </BrowserRouter>
            </LocaleProvider>
        )
    }
}

export default App;
